﻿using CTP.CRM.Core.Common.Enums;
using System.ComponentModel.DataAnnotations;

namespace CTP.CRM.Repository.Employee.ValueObjects
{

    public class EmployeeDataAuthValueObject
    {
        /// <summary>
        /// ctor
        /// </summary>
        public EmployeeDataAuthValueObject()
        { }

        public EmployeeDataAuthValueObject(int uid, AuthSourceEnum type = AuthSourceEnum.人员分配)
        {
            UserId = uid;
            AuthSourceType = type;
        }

        public EmployeeDataAuthValueObject(int uid, AuthSourceEnum type, int OId, string OName)
        {
            UserId = uid;
            AuthSourceType = type;
            AuthOrgId = OId;
            AuthOrgName = OName;
        }

        public int? AuthOrgId { get; set; }
        public string AuthOrgName { get; set; }

        /// <summary>
        /// 员工id
        /// </summary>
        public int EmployeeId { get; set; }

        /// <summary>
        /// 用户id
        /// </summary>
        public int UserId { get; set; }

        /// <summary>
        /// </summary>
        public string EmployeeName { get; set; } = String.Empty;

        /// <summary>
        /// </summary>
        public string UserName { get; set; } = String.Empty;

        /// <summary>
        /// 用户英文名
        /// </summary>
        public string EnName { get; set; } = String.Empty;

        /// <summary>
        /// 权限类型
        /// </summary>
        public string AuthType { get; set; }

        /// <summary>
        /// 权限来源
        /// </summary>
        public string AuthSource { get; set; }

        /// <summary>
        /// 权限来源 （枚举值）
        /// </summary>
        public AuthSourceEnum AuthSourceType { get; set; }

        /// <summary>
        /// 被转移人ID
        /// </summary>
        public int? TransferUserId { get; set; }

        /// <summary>
        /// 被转移人名
        /// </summary>
        public string TransferUserName { get; set; }

        public AgentTypeEnum? AgentType { get; set; }

        /// <summary>
        /// </summary>
        public DateTime? AgentBeginTime { get; set; }

        /// <summary>
        /// </summary>
        public DateTime? AgentEndTime { get; set; }

        /// <summary>
        /// 数据类型
        /// </summary>
        public int? DataType { get; set; }

        /// <summary>
        /// 数据类型名称
        /// </summary>
        public string DataTypeName { get; set; }
        //public enum AuthTypeEnum
        //{
        //    用户分配 = 1,
        //    用户转移分配 = 2,
        //    组织分配 = 3,
        //    组织转移分配 = 4
        //}
        /// <summary>
        /// 部门
        /// </summary>
        public int? DeptId { get; set; }
        /// <summary>
        /// 公司
        /// </summary>
        public int? CompanyId { get; set; }
    }

    /// <summary>
    /// TempOrgWithUser
    /// </summary>
    public class TempOrgWithUser
    {
        /// <summary>
        /// OrgId
        /// </summary>
        public int OrgId { get; set; }

        /// <summary>
        /// uid
        /// </summary>
        public int UserId { get; set; }

        /// <summary>
        /// oname
        /// </summary>
        public string OrgName { get; set; }
    }
}